package com.itheima.mq.rabbitmq.config;

import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.transaction.RabbitTransactionManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: 基础代码
 * @description: rabbit的事务配置类
 * @author: zhanghz001
 * @create: 2021-05-07 17:35
 **/
@Configuration
public class RabbitTransactionConfig {
    
    @Bean("rabbitTransactionManager")
    public RabbitTransactionManager rabbitTransactionManager(ConnectionFactory connectionFactory) {
        return new RabbitTransactionManager(connectionFactory);
    }
    
}
